package com.indexingsystem.boss.admin.mapper;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.ibatis.annotations.Param;

import com.indexingsystem.boss.Vo.StatusList;
import com.indexingsystem.boss.entity.RoleOperations;

public interface RoleOperationsMapper {
	int deleteRoleOperationsByIdBatch(@Param("list") List<String> list);

	/**
	 * 通过roleid来删除角色操作关系表.
	 * 
	 * @param list
	 * @return
	 */
	int deleteBatchRoleOperationsByRoleIds(@Param("list") List<String> list);

	int deleteByPrimaryKey(String roleOperationId);

	int insert(RoleOperations record);

	int insertSelective(RoleOperations record);

	List<RoleOperations> selectRoleOperationsList();

	RoleOperations selectByPrimaryKey(String roleOperationId);

	int updateByPrimaryKeySelective(RoleOperations record);

	int updateByPrimaryKey(RoleOperations record);

	int deleteByRoleKey(String roleId);

	/**
	 * 通过角色id查询功能及操作权限id集合.
	 * 
	 * @param roleId
	 * @return
	 */
	Set<String> getRoleOperationsByRoleId(String roleId);

	/**
	 * 通过功能id查询操作权限id集合.
	 * 
	 * @param functionId
	 * @return
	 */
	Set<String> getPermissionByFunctionIdOrRoleId(RoleOperations roleOperations);
	
    /**
     * 批量启用，禁用功能.
     * 
     * @param statusList
     * @return
     */
    int batchUpdateRoleOperationsWithList(@Param("list") List<StatusList> list);


    /**
     * 批量删除角色功能操作关系操作.
     * 
     * @param functionId
     * @return
     */
    int deleteRoleOperationsByFunctionIdBatch(@Param("list") List<String> list);

    Integer updateByMapSelective(Map<String, Object> str);

    Integer updateByInMapSelective(Map<String, Object> str);
}